//-------------------------------------------------------------------
//	Copyright (c) 2010-2011  Zhirnov Andrey
//	This file is part of the "UXGEN_ResourceConverter" project.
//	See copyright notice in "Converter.h".
//-------------------------------------------------------------------

#ifndef _RC_FONT_CONVERTER_H
#define _RC_FONT_CONVERTER_H

#include "stdafx.h"


class CFontConverter : public IFontConverter
{
private:
	TImage2D		_sImage;
	uint			_uASCIIoffset,
					_uUnicodeOffset;
	array< rectf >	_aChars;
	
private:
	bool _LoadFontDFT(IFilePtr pFile);
	bool _LoadFontFreeType(IFilePtr pFile);

public:
	CFontConverter();
	~CFontConverter();
	
	// IFontConverter //
	virtual HRESULT CALLBACK GetSupportedFormats(char *pBuffer, uint uCount);

	virtual HRESULT CALLBACK Create();
	virtual HRESULT CALLBACK Delete();

	virtual HRESULT CALLBACK Load(const char *pcFileName);
	virtual HRESULT CALLBACK Save(const char *pcFileName);

	virtual HRESULT CALLBACK SetASCOffset(uint uOffset);
	virtual HRESULT CALLBACK SetUnicodeOffset(uint uOffset);
	virtual HRESULT CALLBACK SetCharsCount(uint uCount, uint uDefChar);

	virtual HRESULT CALLBACK GetASCOffset(uint &uOffset);
	virtual HRESULT CALLBACK GetUnicodeOffset(uint &uOffset);
	virtual HRESULT CALLBACK GetCharsCount(uint &uCount);

	// ISubSystem //
	virtual HRESULT CALLBACK GetType(E_SUBSYSTEM_TYPE &eType);
	
	IBASE_IMPLEMENTATION( IFontConverter )
};

#endif	// _RC_FONT_CONVERTER_H